package cn.kgc.itrip.biz.controller;

import cn.kgc.itrip.beans.common.ServerResponse;
import cn.kgc.itrip.beans.model.vo.SearchHotelRoomVo;
import cn.kgc.itrip.biz.service.IHotelService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author 阿泽
 */
@Controller
@RequestMapping("/api/hotelroom")
public class hotelroomcontroller {

    @Resource
    IHotelService iHotelService;

    /**
     * 根据targetId查询酒店房型图片(type=1)
     */

    @RequestMapping(value = "/getimg/{targetId}", method = RequestMethod.GET)
    @ResponseBody
    public ServerResponse getimg(@PathVariable Integer targetId) {

        return iHotelService.queryHotelImage(targetId, "1");
    }
    /**
     * GET /api/hotelroom/queryhotelroombed
     * 查询酒店房间床型列表
     */
    @RequestMapping(value = "/queryhotelroombed", method = RequestMethod.GET)
    @ResponseBody
    public ServerResponse getimg() {
        return ServerResponse.createBySuccess(iHotelService.queryhotelroombed());
    }
    /**
     *  /api/hotelroom/queryhotelroombyhotel
     * 查询酒店房间列表
     */
    @RequestMapping(value = "/queryhotelroombyhotel", method = RequestMethod.POST)
    @ResponseBody
    public ServerResponse queryhotelroombyhotel(@RequestBody SearchHotelRoomVo vo) {
        return iHotelService.queryhotelroombyhotel(vo);
    }
}
